/*
 * @(#)RedwareCollector
 *
 * Copyright 2001-2005 友联创新科技
 * 
 */
package com.sinodata.bsm.cicp.collector.net.radware;

import java.util.Arrays;
import java.util.List;

import com.sinodata.bsm.cicp.collector.Collector;
import com.sinodata.bsm.common.vo.ResPropertyValue;
import com.sinodata.bsm.common.vo.ResPropertyValue.PropValue;
import com.union.net.discovery.agent.ext.Radware;

/**
 * RadwareCollector.java
 * <p>
 * Redware基本指标采集
 *
 * @author 李祥军 lixj@uni-mon.com
 * @version 1.0 
 * @Date 2010-7-6
 */
public class RadwareCollector extends Collector {
    static String[] ParamMeta = { "共同体" };
    static String[] PropMeta = { "资源使用率", "CPU使用率", "网络使用率" };

    @Override
    public List<ResPropertyValue> collect(String ip) {
        Radware radware = Radware.getRadware(ip, getParamMap().get(ParamMeta[0]));
        ResPropertyValue propertyValueX = new ResPropertyValue();
        PropValue[] propValues = new PropValue[3];
        propValues[0] = ResPropertyValue.createPropValue(radware.getRsWSDResourceUtilization(), PropMeta[0]);
        propValues[1] = ResPropertyValue.createPropValue(radware.getRsWSDRSResourceUtilization(), PropMeta[1]);
        propValues[2] = ResPropertyValue.createPropValue(radware.getRsWSDREResourceUtilization(), PropMeta[2]);
        propertyValueX.setValues(propValues);
        return Arrays.asList(propertyValueX);
    }

    @Override
    public String[] getParamMeta() {
        return ParamMeta;
    }

    @Override
    public String[] getPropMeta() {
        return PropMeta;
    }

}
